package unit6.part3;

import java.util.LinkedList;

public class LinkedListTest {
    public static void main(String[] args) {
        LinkedList<Integer> list = new LinkedList<>();
        list.add(100);
        list.addFirst(50); // 添加首
        list.addLast(150); // 添加尾
        System.out.println(list);

        System.out.println(list.getFirst()); // 查询首
        System.out.println(list.getLast()); // 查询尾

        System.out.println(list.removeFirst());// 删除首
        System.out.println(list.removeLast());// 删除尾
        System.out.println(list);
    }
}
